from django.core.mail import send_mail
from celery_tasks.main import app
from meiduo_shop import settings

@app.task
def senf_active(verify_url,email):
    # 这个是发送的标题
    subject = "尊敬的王先生你好，这是你的入职邮箱，请注意查收"
    message = ''
    # 这是发送邮件和的链接和邮箱账号
    from_email = settings.EMAIL_FROM
    html_message = '<p>尊敬的用户您好！</p>' \
                   '<p>感谢您使用美多商城。</p>' \
                   '<p>您的邮箱为：%s 。请点击此链接激活您的邮箱：</p>' \
                   '<p><a href="%s">%s<a></p>' % (email,verify_url, verify_url)
    recipient_list = [email, 'm18637702676@163.com']
    send_mail(
            subject=subject,
            message=message,
            from_email=from_email,
            recipient_list=recipient_list,
            html_message=html_message

        )
